<template>
  <div>{{ res }}</div>
</template>

<script setup>
import { computed, ref } from "vue";
const arr = ref([1, 2, 3, 4, 5]);
const res = computed(() => {
  return arr.value.reduce((sum, item) => sum + item, 0);
});
</script>

<style lang="scss" scoped></style>
